* Import data (pulled from the R script) ---------------------------------------

	import delimited using ${CENSUS-DISTRICT}, clear
	destring district, replace force
		
		* Raw population for Black, Hispanics, and the universe
		keep district ///
			b02001_003e b02001_001e ///
			b03003_003e b03002_004e ///
			b03002_012e b03003_001e ///
			all_crimes violent_crimes
			
		* The data is on district level. Now we calculate region level data
		gen unit_region = 0
			
			replace unit_region = 2 if inlist(district, 4, 5, 6, 7, 22)
			replace unit_region = 1 if ///
								inlist(district, 1, 2, 3, 8, 9, 10, 12, 13, 18)
			replace unit_region = 3 if ///
							inlist(district, 11, 14, 15, 16, 17, 19, 20, 24, 25)
			
				* Make a summary for region
				preserve
					collapse (sum) b* all_crimes violent_crimes, by(unit_region)
					tempfile region
					save `region'
				restore
			
				* Make a summary for city
				preserve
					collapse (sum) b* all_crimes violent_crimes
					tempfile city
					save `city'
				restore
				
			* Merge
			app using `region' `city'
		
			replace district = 100 + unit_region if missing(district)
					* Here I make district 101, 102, and 103 to later impute
					* For police who worked in the region
				
			replace district = 1000 if missing(district)
					* To impute for police who work through out Chicago
					
		* Calculate percent Black & Percent hispanic
		gen p_black = b02001_003e / b02001_001e
		gen p_hispanic = b03003_003e / b03003_001e
		gen p_black_or_hispanic = (b03002_004e + b03002_012e )/ b03003_001e
		
		* Crime rate is measure at monthly level (hence divided by 25 months)
		* As per 1K capita
		
		gen violent_crime_monthly_1K = 1000* (violent_crimes /25 ) / b02001_001e
		gen all_crime_monthly_1K = 1000* (all_crimes /25 ) / b02001_001e
		
		keep district p* *monthly_1K

* Save -------------------------------------------------------------------------

	save ${FilePath5}.dta, replace
	
		